package com.huajia.controller;

import com.huajia.common.Result;
import com.huajia.entity.User;
import com.huajia.service.IUserService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.TimeUnit;
import java.util.stream.IntStream;

/**
 * 用户表 前端控制器
 *
 * @author lin
 */
@Slf4j
@RestController
@RequestMapping("/user")
public class UserController {

    @Autowired
    IUserService userService;

    @PostMapping("/getUserList")
    public Result<?> getUserList(@RequestBody User user) {
        return userService.getUserList(user);
    }



    @PostMapping("/addUser")
    public Result<?> addUser(@RequestBody User user) {
        return userService.addUser(user);
    }

}

